from parse import stmt_sequence
def skipCodeLine() -> int:
    pass

def cGen(parseTree):
    if parseTree.kind == 'stmt':genStmt(parseTree)
    elif parseTree.kind == 'exp':
        genExp(parseTree)

def genExp(parseTree):

    pass

def genStmt(parseTree):
    if parseTree.nodeKind == 'if':
        p1 = parseTree.child[0] # test
        p2 = parseTree.child[1] # then
        p3 = parseTree.child[2] # else

        if cGen(p1):
            cGen(p2)
        else:
            cGen(p3)

    elif parseTree.nodeKind == 'repeat':
        pass
    elif parseTree.nodeKind == 'assign':
        pass
    elif parseTree.nodeKind == 'read':
    elif parseTree.nodeKind == 'write':

    pass

if __name__ == '__main__':
    parseTree = stmt_sequence()
    genStmt(parseTree)
    pass